/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * uniview
 * Copyright (C) Michael Josef Beer 2010 <michael.josef.beer@googlemail.com>
 * 
 * uniview is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * uniview is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _PROJECTION_H_
#define _PROJECTION_H_

#include <cmath>

namespace uniview {

   class Projection
   {
      public:

         Projection() : fov(M_PI * 0.25), f(1.0), x(640), y(480) {};

         double *project(double *point);

         void setFOV(double angel);

         void setF(double f);

         void setResolution(int x, int y);

         void setRemainingParams(double *params);

         void setProjectionFunction(double *(func)(double *, double, double *));

         double *plainProjection(double *point, double *res);

         double *fisheyeProjection(double *point, double *res);


      protected:

         double *(* func)(double *, double, double *);
         double fov;
         double f;
         int x, y;
         double *params;
         
      private:

   };

};

#endif // _PROJECTION_H_
